import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/home/index.vue'
// 懒加载
const My = () =>
    import ('../views/my/index.vue')

import Question from '../views/question/index.vue'
import Video from '../views/video/index.vue'


Vue.use(VueRouter)

const routes = [{
    path: '/',
    name: 'Home',
    component: Home
}, {
    path: '/my',
    name: 'My',
    component: My
}, {
    path: '/question',
    name: 'Question',
    component: Question
}, {
    path: '/video',
    name: 'Video',
    component: Video
}, ]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router